package com.hs.srm.admin.modules.notice.service.impl;

import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hs.srm.admin.modules.notice.dao.NoticeMessageTouserDao;
import com.hs.srm.admin.modules.notice.entity.NoticeMessageTouserEntity;
import com.hs.srm.admin.modules.notice.service.NoticeMessageTouserService;
import com.hs.srm.base.common.utils.QueryParam;
import com.hs.srm.common.utils.PageUtils;


@Service("noticeMessageTouserService")
public class NoticeMessageTouserServiceImpl extends ServiceImpl<NoticeMessageTouserDao, NoticeMessageTouserEntity> implements NoticeMessageTouserService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<NoticeMessageTouserEntity> page = this.selectPage(
                new QueryParam<NoticeMessageTouserEntity>(params).getPage(),
                new EntityWrapper<NoticeMessageTouserEntity>().and("publish = 1").orderBy("create_time desc")
        );
        return new PageUtils(page);
    }

}
